﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Threading;
using ADNDNetwork;

namespace ADNDNetwork.Network.Client
{
    public class ClientManager
    {
        private static ClientManager clientManager;
        private List<Client> clients;
        private Client server;

        private ClientManager()
        {
            clients = new List<Client>();
        }

        public static ClientManager GetInstance()
        {
            if (clientManager == null)
                clientManager = new ClientManager();

            return clientManager;
        }

        public void SendMessageToServer(AdndMessage message)
        {
            lock (clients[0])
            {
                clients[0].Message = message;
            }
        }

        public void AddClient(Client client)
        {
            clients.Add(client);
        }
    }
}
